package com.py.custom.business.demo.protocol.request;

import com.py.custom.business.demo.protocol.groups.StudentGroup;
import com.py.custom.business.demo.protocol.valid.DateValid;
import com.py.custom.common.web.request.BaseRequest;
import com.py.custom.common.web.valid.annotation.CustomValid;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * description：
 */
@Data
@CustomValid(handler = DateValid.class, message = "年龄判断", groups = StudentGroup.DefaultGroup.class)
public class StudentRequest extends BaseRequest {

    private Long id;

    @NotNull(message = "名字不能为空", groups = StudentGroup.SaveGroup.class)
    private String name;

    private String sex;

    private Long date;

    private Integer age;

    @Min(value = 1, message = "页码不能小于1", groups = StudentGroup.DefaultGroup.class)
    private Integer pageNum;

    @Min(value = 1, message = "条数不能小于1", groups = StudentGroup.DefaultGroup.class)
    private Integer pageSize;
}
